<%@ page import="com.sample.service.JmsReceiver" %>
<%@ page import="org.springframework.context.ApplicationContext" %>
<%@ page import="org.springframework.context.support.ClassPathXmlApplicationContext" %>
<%@ page import="javax.jms.Message" %>
<%@ page import="javax.jms.ObjectMessage" %>
<%@ page import="javax.jms.TextMessage" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head><title>Hello :: Spring Application</title></head>
<body>
<h1>Hello - Spring Application</h1>
<%
   String[] xml = {"classpath:applicationContext.xml"};
   ApplicationContext context = new ClassPathXmlApplicationContext(xml);
   JmsReceiver receiver = (JmsReceiver) context.getBean("jmsReceiver");
   Message message = receiver.receive();
   ObjectMessage om = (ObjectMessage) message;
   String text = (String) om.getObject();
%>
Message: <%=text%>
</body>
</html>